home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS in a Box 7
/
BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso
/
Files
/
Prog
/
T
/
TIFF Code.cpt
/
sample.h
< prev
next >
Wrap
Text File
|
1987-12-01
|
3KB
|
135 lines
/* Specifics for non-library modules */
/*
* Types
*/
typedef String(63) Str63;
typedef union {
Int16 s;
Int32 l;
} Int16or32;
typedef Int16or32 *Int16or32Ptr;
typedef Int16 *Int16Ptr;
typedef Int32 *Int32Ptr;
typedef char *asciiPtr;
/* image description type - "id".
*
* The structure consists of all known tags at a certain revision of the
* TIFF specification. If the size number of items are predetermined by
* the specification and consist of a reasonably small data item, then they
* are given space in the structure directly. If the number of items or
* the size of the item is unknown, then a pointer to the type is allocated
* in the structure and it will be necessary to allocate the necessary
* memory for the tag value or values. */
typedef struct {
Int16 subfileType, /* 1 SHORT */
imageWidth,
imageLength;
Int16Ptr bitsPerSample, /* ? SHORTS */
compression;
Int16 photoInterp, /* 1 SHORT */
threshholding,
cellWidth,
cellLength,
fillOrder;
asciiPtr docName, /* ASCII */
imageDescription,
make,
model;
Int16or32Ptr stripOffsets; /* ? SHORTS or LONGS */
Int16 orientation, /* 1 SHORT */
samplesPerPixel;
Int32 rowsPerStrip; /* 1 SHORT or 1 LONG */
Int32 stripsPerImage; /* not a tag */
Int16or32Ptr stripByteCounts; /* ? LONGS */
Int16Ptr minSampleValue, /* ? SHORTS */
maxSampleValue;
Rational xResolution, /* 1 RATIONAL */
yResolution;
Int16 planarConfig; /* 1 SHORT */
asciiPtr pageName; /* ASCII */
Rational xPosition, /* 1 Rationals */
yPosition;
Int32Ptr freeOffsets,
freeByteCounts;
Int16 grayResponseUnit; /* 1 SHORT */
Int16Ptr grayResponseCurve;
Int32 group3Options, /* 1 LONG */
group4Options;
Int16 resolutionUnit; /* 1 SHORT */
Int16 pageNumber[2]; /* 2 SHORTS */
Int16 colorResponseUnit; /* 1 SHORT */
Int16Ptr colorResponseCurves;/* ? SHORTS */
} id;
/*
* Macros
*/
/* Return minimum of two values */
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
/* Static String Declaration Macro */
#define StatString(name, string)\
struct {\
unsigned char length;\
unsigned char text[sizeof(string)];\
} name = {\
sizeof(string) - 1,\
string\
}
/*
* Constant Defines
*/
/* Creator and Filetype for files we create */
#define CREATOR ((OSType)'PUBP')
#define FILETYPE ((OSType)'TIFF')
/*
* Routine Declarations
*/
void DoOpen(),
DoClose(),
DoSave(),
DoSaveAs(),
DoQuitCleanUp();
Boolean ReadTiff();
void WriteTiff();
Ptr MyNewPtr();
void MyDisposPtr();
Handle MyNewHandle();
void MyDisposHandle();
Int16 TypeSize();
void ClipPictToImage(),
ImageToClipPict(),
ClearImage(),
DisplayImage();
Boolean PutTags();
TiffDirEntry GetDirEntry();
/*
* Debug specific
*/
#ifdef DEBUG
void DebugMessage();
#define DBG(x) x
#else
#define DBG(x)
#endif